﻿#region 命名空间

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WinnerCMS.BLL;
using WinnerCMS.Model;
using WinnerCMS.Model.Attribute;

#endregion

namespace WinnerCMS.WebUI.Admin.Role
{
    [Access]
    public partial class Manage : Page
    {
        private readonly RoleManage _myBll = new RoleManage();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGrid();
            }
        }

        protected void GV_List_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            this._myBll.Delete(Convert.ToInt32(this.GV_List.DataKeys[e.RowIndex].Value), true);

            BindGrid();
        }

        private void BindGrid()
        {
            this.GV_List.DataSource = this._myBll.BindList(true);
            this.GV_List.DataBind();
        }
    }
}